Optimal. Leaf size=325 \[ \frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \text {ArcTan}\left (e^{c+d x}\right )}{3 a d^2}-\frac {4 f (e+f x) \log \left (1+e^{2 (c+d x)}\right )}{3 a d^2}-\frac {f^2 \text {PolyLog}\left (2,-i e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \text {PolyLog}\left (2,i e^{c+d x}\right )}{3 a d^3}-\frac {2 f^2 \text {PolyLog}\left (2,-e^{2 (c+d x)}\right )}{3 a d^3}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.27, antiderivative size = 325, normalized size of antiderivative = 1.00, number of steps
used = 16, number of rules used = 12, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.387, Rules used = {5690, 4271,
3852, 8, 4269, 3799, 2221, 2317, 2438, 5559, 4270, 4265} \begin {gather*} -\frac {2 i f (e+f x) \text {ArcTan}\left (e^{c+d x}\right )}{3 a d^2}-\frac {f^2 \text {Li}_2\left (-i e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \text {Li}_2\left (i e^{c+d x}\right )}{3 a d^3}-\frac {2 f^2 \text {Li}_2\left (-e^{2 (c+d x)}\right )}{3 a d^3}-\frac {f^2 \tanh (c+d x)}{3 a d^3}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}-\frac {4 f (e+f x) \log \left (e^{2 (c+d x)}+1\right )}{3 a d^2}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}-\frac {i f (e+f x) \tanh (c+d x) \text {sech}(c+d x)}{3 a d^2}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}+\frac {(e+f x)^2 \tanh (c+d x) \text {sech}^2(c+d x)}{3 a d}+\frac {2 (e+f x)^2}{3 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2221
Rule 2317
Rule 2438
Rule 3799
Rule 3852
Rule 4265
Rule 4269
Rule 4270
Rule 4271
Rule 5559
Rule 5690
Rubi steps
\begin {align*} \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx &=-\frac {i \int (e+f x)^2 \text {sech}^3(c+d x) \tanh (c+d x) \, dx}{a}+\frac {\int (e+f x)^2 \text {sech}^4(c+d x) \, dx}{a}\\ &=\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}+\frac {2 \int (e+f x)^2 \text {sech}^2(c+d x) \, dx}{3 a}-\frac {(2 i f) \int (e+f x) \text {sech}^3(c+d x) \, dx}{3 a d}-\frac {f^2 \int \text {sech}^2(c+d x) \, dx}{3 a d^2}\\ &=-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}-\frac {(i f) \int (e+f x) \text {sech}(c+d x) \, dx}{3 a d}-\frac {(4 f) \int (e+f x) \tanh (c+d x) \, dx}{3 a d}-\frac {\left (i f^2\right ) \text {Subst}(\int 1 \, dx,x,-i \tanh (c+d x))}{3 a d^3}\\ &=\frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \tan ^{-1}\left (e^{c+d x}\right )}{3 a d^2}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}-\frac {(8 f) \int \frac {e^{2 (c+d x)} (e+f x)}{1+e^{2 (c+d x)}} \, dx}{3 a d}-\frac {f^2 \int \log \left (1-i e^{c+d x}\right ) \, dx}{3 a d^2}+\frac {f^2 \int \log \left (1+i e^{c+d x}\right ) \, dx}{3 a d^2}\\ &=\frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \tan ^{-1}\left (e^{c+d x}\right )}{3 a d^2}-\frac {4 f (e+f x) \log \left (1+e^{2 (c+d x)}\right )}{3 a d^2}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}-\frac {f^2 \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{c+d x}\right )}{3 a d^3}+\frac {\left (4 f^2\right ) \int \log \left (1+e^{2 (c+d x)}\right ) \, dx}{3 a d^2}\\ &=\frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \tan ^{-1}\left (e^{c+d x}\right )}{3 a d^2}-\frac {4 f (e+f x) \log \left (1+e^{2 (c+d x)}\right )}{3 a d^2}-\frac {f^2 \text {Li}_2\left (-i e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \text {Li}_2\left (i e^{c+d x}\right )}{3 a d^3}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}+\frac {\left (2 f^2\right ) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 (c+d x)}\right )}{3 a d^3}\\ &=\frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \tan ^{-1}\left (e^{c+d x}\right )}{3 a d^2}-\frac {4 f (e+f x) \log \left (1+e^{2 (c+d x)}\right )}{3 a d^2}-\frac {f^2 \text {Li}_2\left (-i e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \text {Li}_2\left (i e^{c+d x}\right )}{3 a d^3}-\frac {2 f^2 \text {Li}_2\left (-e^{2 (c+d x)}\right )}{3 a d^3}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 8.42, size = 576, normalized size = 1.77 \begin {gather*} \frac {\frac {20 i f \left (d (e+f x) \left (i e^c \log \left (1-i e^{-c-d x}\right )+\log \left (1+i e^{c+d x}\right )\right )-i e^c f \text {PolyLog}\left (2,i e^{-c-d x}\right )+f \text {PolyLog}\left (2,-i e^{c+d x}\right )\right )}{-i+e^c}+6 f \left (d \left (\frac {d e^c x (2 e+f x)}{i+e^c}-2 (e+f x) \log \left (1-i e^{c+d x}\right )\right )-2 f \text {PolyLog}\left (2,i e^{c+d x}\right )\right )+\frac {-2 i f^2 \cosh (c)+2 d f (e+f x) \cosh (d x)-2 i d^2 e^2 \cosh (c+d x)+4 i f^2 \cosh (c+d x)-4 i d^2 e f x \cosh (c+d x)-2 i d^2 f^2 x^2 \cosh (c+d x)+2 d e f \cosh (2 c+d x)+2 d f^2 x \cosh (2 c+d x)+4 i d^2 e^2 \cosh (c+2 d x)-2 i f^2 \cosh (c+2 d x)+8 i d^2 e f x \cosh (c+2 d x)+4 i d^2 f^2 x^2 \cosh (c+2 d x)+8 d^2 e^2 \sinh (d x)-2 f^2 \sinh (d x)+16 d^2 e f x \sinh (d x)+8 d^2 f^2 x^2 \sinh (d x)+d^2 e^2 \sinh (2 (c+d x))-2 f^2 \sinh (2 (c+d x))+2 d^2 e f x \sinh (2 (c+d x))+d^2 f^2 x^2 \sinh (2 (c+d x))+2 f^2 \sinh (2 c+d x)}{\left (\cosh \left (\frac {c}{2}\right )-i \sinh \left (\frac {c}{2}\right )\right ) \left (\cosh \left (\frac {c}{2}\right )+i \sinh \left (\frac {c}{2}\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )-i \sinh \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^3}}{12 a d^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 3.05, size = 509, normalized size = 1.57
method | result | size |
risch | \(\frac {2 i \left (-2 i d^{2} f^{2} x^{2}+4 d^{2} x^{2} f^{2} {\mathrm e}^{d x +c}-d \,f^{2} x \,{\mathrm e}^{3 d x +3 c}-4 i d^{2} e f x +8 d^{2} e f x \,{\mathrm e}^{d x +c}-d e f \,{\mathrm e}^{3 d x +3 c}-2 i d^{2} e^{2}+i f^{2} {\mathrm e}^{2 d x +2 c}+4 d^{2} e^{2} {\mathrm e}^{d x +c}-d \,f^{2} x \,{\mathrm e}^{d x +c}-f^{2} {\mathrm e}^{3 d x +3 c}-d e f \,{\mathrm e}^{d x +c}+i f^{2}-f^{2} {\mathrm e}^{d x +c}\right )}{3 \left ({\mathrm e}^{d x +c}+i\right ) \left ({\mathrm e}^{d x +c}-i\right )^{3} d^{3} a}-\frac {5 e f \ln \left ({\mathrm e}^{d x +c}-i\right )}{3 d^{2} a}-\frac {f e \ln \left ({\mathrm e}^{d x +c}+i\right )}{a \,d^{2}}+\frac {8 e f \ln \left ({\mathrm e}^{d x +c}\right )}{3 d^{2} a}+\frac {5 f^{2} c \ln \left ({\mathrm e}^{d x +c}-i\right )}{3 d^{3} a}+\frac {f^{2} c \ln \left ({\mathrm e}^{d x +c}+i\right )}{a \,d^{3}}-\frac {8 f^{2} c \ln \left ({\mathrm e}^{d x +c}\right )}{3 d^{3} a}+\frac {4 f^{2} x^{2}}{3 a d}+\frac {8 f^{2} c x}{3 d^{2} a}+\frac {4 f^{2} c^{2}}{3 a \,d^{3}}-\frac {f^{2} \ln \left (1-i {\mathrm e}^{d x +c}\right ) x}{a \,d^{2}}-\frac {f^{2} \ln \left (1-i {\mathrm e}^{d x +c}\right ) c}{a \,d^{3}}-\frac {f^{2} \polylog \left (2, i {\mathrm e}^{d x +c}\right )}{a \,d^{3}}-\frac {5 f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) x}{3 d^{2} a}-\frac {5 f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) c}{3 a \,d^{3}}-\frac {5 f^{2} \polylog \left (2, -i {\mathrm e}^{d x +c}\right )}{3 a \,d^{3}}\) | \(509\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 724 vs. \(2 (289) = 578\).
time = 0.37, size = 724, normalized size = 2.23 \begin {gather*} -\frac {8 \, c d f e - 2 \, {\left (2 \, c^{2} - 1\right )} f^{2} - 4 \, d^{2} e^{2} + 2 \, f^{2} e^{\left (2 \, d x + 2 \, c\right )} + 3 \, {\left (f^{2} e^{\left (4 \, d x + 4 \, c\right )} - 2 i \, f^{2} e^{\left (3 \, d x + 3 \, c\right )} - 2 i \, f^{2} e^{\left (d x + c\right )} - f^{2}\right )} {\rm Li}_2\left (i \, e^{\left (d x + c\right )}\right ) + 5 \, {\left (f^{2} e^{\left (4 \, d x + 4 \, c\right )} - 2 i \, f^{2} e^{\left (3 \, d x + 3 \, c\right )} - 2 i \, f^{2} e^{\left (d x + c\right )} - f^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right ) - 4 \, {\left (d^{2} f^{2} x^{2} - c^{2} f^{2} + 2 \, {\left (d^{2} f x + c d f\right )} e\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (4 i \, d^{2} f^{2} x^{2} + i \, d f^{2} x + {\left (-4 i \, c^{2} + i\right )} f^{2} + {\left (8 i \, d^{2} f x + {\left (8 i \, c + i\right )} d f\right )} e\right )} e^{\left (3 \, d x + 3 \, c\right )} + 2 \, {\left (i \, d f^{2} x + {\left (8 i \, c + i\right )} d f e + {\left (-4 i \, c^{2} + i\right )} f^{2} - 4 i \, d^{2} e^{2}\right )} e^{\left (d x + c\right )} + 3 \, {\left (c f^{2} - d f e - {\left (c f^{2} - d f e\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (i \, c f^{2} - i \, d f e\right )} e^{\left (3 \, d x + 3 \, c\right )} + 2 \, {\left (i \, c f^{2} - i \, d f e\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} + i\right ) + 5 \, {\left (c f^{2} - d f e - {\left (c f^{2} - d f e\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (i \, c f^{2} - i \, d f e\right )} e^{\left (3 \, d x + 3 \, c\right )} + 2 \, {\left (i \, c f^{2} - i \, d f e\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} - i\right ) - 5 \, {\left (d f^{2} x + c f^{2} - {\left (d f^{2} x + c f^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} - 2 \, {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (3 \, d x + 3 \, c\right )} - 2 \, {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (i \, e^{\left (d x + c\right )} + 1\right ) - 3 \, {\left (d f^{2} x + c f^{2} - {\left (d f^{2} x + c f^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} - 2 \, {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (3 \, d x + 3 \, c\right )} - 2 \, {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (-i \, e^{\left (d x + c\right )} + 1\right )}{3 \, {\left (a d^{3} e^{\left (4 \, d x + 4 \, c\right )} - 2 i \, a d^{3} e^{\left (3 \, d x + 3 \, c\right )} - 2 i \, a d^{3} e^{\left (d x + c\right )} - a d^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \left (\int \frac {e^{2} \operatorname {sech}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {f^{2} x^{2} \operatorname {sech}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {2 e f x \operatorname {sech}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (e+f\,x\right )}^2}{{\mathrm {cosh}\left (c+d\,x\right )}^2\,\left (a+a\,\mathrm {sinh}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________